package main

import "fmt"

type Books1 struct {
	name  string
	title string
	id    int
}

// 传递一个book的副本
func changeBook11(books11 Books1) {
	books11.title = "nateshao"
}

// 指针传递
func changeBooks22(books22 *Books1) {
	books22.title = "布偶猫"
}

func main() {

	var book11 Books1
	book11.title = "千羽"
	book11.name = "张三"
	fmt.Printf("%v\n", book11)

	fmt.Println("----------- changeBook11(book11) ----------")

	changeBook11(book11)

	fmt.Println("---------- changeBooks22(&book11) -----------")
	changeBooks22(&book11)
	fmt.Printf("%v\n", book11)
}
